using System;
using System.Security.Cryptography;
using System.Text;

namespace CodingBlog.Core.ExtensionMethods
{
    public static class StringExtensions
    {
        public static string ComputeHash(this string value)
        {
            var valueBytes = Encoding.UTF8.GetBytes(value);
            var hashedBytes = new MD5CryptoServiceProvider().ComputeHash(valueBytes);
            
            return BitConverter.ToString(hashedBytes);
        }
    }
}